package ch.il07.converter.business;

import ch.il07.converter.persistence.exceptions.NoSuchMeasurandException;
import ch.il07.converter.persistence.exceptions.NoSuchUnitException;
import ch.il07.converter.persistence.exceptions.NoSuchUserException;


public interface Converter extends Service {
	/**
	 * Calculates/converts amount from fromUnitName to toUnitName in measurandName.
	 * {UseCase "Masseinheit umrechnen"}
	 * @param owner Username/owner of the measurand
	 * @param measurandName Measurand to search for the units 
	 * @param fromUnitName Source unit
	 * @param toUnitName Destination unit
	 * @param amount Number
	 * @return Result of calculation (or null on error)
	 * @throws NoSuchMeasurandException
	 * @throws NoSuchUnitException 
	 * @throws NoSuchUserException 
	 */
	public Double calculate(String owner, String measurandName, String fromUnitName, String toUnitName, Double amount) throws NoSuchMeasurandException, NoSuchUserException, NoSuchUnitException;
}